<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2022/3/18
  Time: 9:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<base href="<%=basePath %>" />
<html>
<head>
    <title>Title</title>
    <div class="layuimini-container layuimini-page-anim">
        <div class="layuimini-main">

            <fieldset class="table-search-fieldset">
                <legend>搜索信息</legend>
                <div style="margin: 10px 10px 10px 10px">
                    <form class="layui-form layui-form-pane" action="">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">用户名</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="keyword" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-inline">
                                <button type="submit" class="layui-btn layui-btn-primary"  lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
                            </div>
                        </div>
                    </form>
                </div>
            </fieldset>
            <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

        </div>
    </div>
</head>
<script type="text/html" id="usernameTpl">
    <span style="color: red">{{d.user.username}}</span>
</script>
<script type="text/html" id="hnameTpl">
    <span style="color: red">{{d.mhall.name}}</span>
</script>
<script type="text/html" id="nameTpl">
    <span style="color: red">{{d.movie.name}}</span>
</script>
<script type="text/html" id="sdateTpl">
    <span style="color: red">{{d.nofs.sdate}}</span>
</script>
<script type="text/html" id="edateTpl">
    <span style="color: red">{{d.nofs.edate}}</span>
</script>
<script type="text/html" id="priceTpl">
    <span style="color: red">{{d.nofs.price}}</span>
</script>
<script>
    layui.use(['form', 'table','miniPage','element'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table,
            miniPage = layui.miniPage;

        table.render({
            elem: '#currentTableId',
            url: 'Flim_Order/listData.do',
            toolbar: '#toolbarDemo',
            defaultToolbar: ['filter', 'exports', 'print', {
                title: '提示',
                layEvent: 'LAYTABLE_TIPS',
                icon: 'layui-icon-tips'
            }],
            cols: [[
                {type: "checkbox", width: 50},
                {field: 'id', width: 150, title: '订单编号', sort: true},
                {field: 'user', width: 150, title: '用户名',templet:"#usernameTpl"},
                {field: 'movie', width: 150, title: '电影名称', templet:"#nameTpl"},
                {field: 'mhall', width: 150, title: '影厅号',templet:"#hnameTpl"},
                {field: 'seats', width: 150, title: '座位',sort: true},
                {field: 'nofs', width: 150, title: '开始时间',templet:"#sdateTpl"},
                {field: 'nofs', width: 150, title: '结束时间',templet:"#edateTpl"},
                {field: 'nofs', width: 200, title: '订单价格',templet:"#priceTpl"},
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,
            page: true,
            skin: 'line'
        });

        // 监听搜索操作
        form.on('submit(data-search-btn)', function (data) {
            var result = JSON.stringify(data.field);
            //执行搜索重载
            table.reload('currentTableId', {
                page: {
                    curr: 1
                }
                , where: data.field
            }, 'data');

            return false;
        });
    });
</script>
</body>
</html>

